$("#form-purchaseInfo-add").validate({
	rules:{
		xxxx:{
			required:true,
		},
	},
	submitHandler:function(form){
		add();
	}
});


$(function(){
	
})


function initFileUpload(prefix){
	$("#fileImage").fileinput({
		language : 'zh', //中文
		uploadUrl : '',
		showPreview : true, //展前预览
		showUpload : false, //不显示上传按钮
		showCaption : false, //不显示文字表述
		uploadAsync : false, //采用同步上传
		removeFromPreviewOnError : true, //当文件不符合规则，就不显示预览
		maxFileCount : 5,
		maxFileSize : 1024 * 10, //单位为kb，如果为0表示不限制文件大小
		allowedFileExtensions : [ "jpg", "jpeg", "gif", "png", "bmp" ],
		uploadExtraData : function(previewId, index) { //额外参数 返回json数组
			return {
				'id' : commId
			};
		}
	}).on("filebatchuploadsuccess", function(event, data) { //当上传成功回调函数
		var response = data.response;
		if (response.resultCode == '0') {
			$("#closedAddWin").click();
			table.ajax.reload();
		}
	});
}


function add() {
    _ajax_save(ctx + "business/purchaseInfo/save", $('#form-purchaseInfo-add').serialize());
}